
package hk.ces.oxfam.patch;

import java.util.HashMap;
import java.util.Map;

/**
 *
 * @author ReutyCheng
 */
public class DBPatchSession
{
  public static final String CURRENT_PATCH = "CURRENT_PATCH";
  public static final String CURRENT_TRANSACTION_TYPE = "CURRENT_TRANSACTION_TYPE";

  private static final Map<String, Object> SESSION_MAP = new HashMap<String, Object>();

  public static synchronized void put(String key, Object value)
  {
    SESSION_MAP.put(key, value);
  }

  public static synchronized Object get(String key)
  {
    return SESSION_MAP.get(key);
  }

  public static synchronized <T> T get(String key, Class<T> clazz)
  {
    return (T) SESSION_MAP.get(key);
  }

  public static synchronized void clear()
  {
    SESSION_MAP.clear();
  }
}
